import random
num=random.randint(1,10)

guess=int(input('请输入你想要猜测的数字:'))
if num==guess:
    print("猜中了")
elif guess!=num:
    if guess>num:
        print('大了')
    else:
        print('小了')

    guess=int(input('再猜一次:'))

    if guess==num:
        print('猜中了')
    elif guess!=num:
        if guess>num:
            print('大了')
        else:
            print('小了')
        guess=int(input('最后猜一次:'))

        if guess==num:
            print('猜中了')
        elif guess!=num:
            print("错啦,正确答案是%d"%num)